home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Workspace / AltDock / Source / DockListener.m < prev    next >
Text File  |  1995-06-12  |  1KB  |  52 lines

  1. #import <appkit/appkit.h>
  2. #import "DockListener.h"
  3. #import <mach.h>
  4. #import <sys/message.h>
  5. #import <servers/netname.h>
  6. extern port_t name_server_port;
  7. extern id NXResponsibleDelegate();
  8. @implementation  DockListener :Listener
  9. {}
  10. static NXRemoteMethod *remoteMethods = NULL;
  11. #define REMOTEMETHODS 1
  12. + initialize 
  13. /* */
  14. {
  15.     if (!remoteMethods) {
  16.     remoteMethods =
  17.     (NXRemoteMethod *) malloc((REMOTEMETHODS+1)*sizeof(NXRemoteMethod));
  18.     remoteMethods[0].key = 
  19.     @selector(unhide);
  20.     remoteMethods[0].types = "";
  21.     remoteMethods[REMOTEMETHODS].key = NULL;
  22.     }
  23. }
  24. -(int)unhide
  25. /* */
  26. {
  27.     id _NXd;
  28.     if (_NXd = NXResponsibleDelegate(self,
  29.     @selector(unhide)))
  30.     return [_NXd unhide];
  31.     return -1;
  32. }
  33.  
  34. - (int) performRemoteMethod : (NXRemoteMethod *) method
  35.                   paramList : (NXParamValue *) paramList {
  36. /* */
  37.     switch (method - remoteMethods) {
  38.     case 0:
  39.     return [self unhide];
  40.     default:
  41.     return [super performRemoteMethod : method paramList : paramList];
  42.     }
  43. }
  44. - (NXRemoteMethod *) remoteMethodFor: (SEL) aSel {
  45. /* */
  46.     NXRemoteMethod *rm;
  47.     if (rm = NXRemoteMethodFromSel(aSel,remoteMethods))
  48.         return rm;
  49.     return [super remoteMethodFor : aSel];
  50. }
  51. @end
  52.